#!/bin/sh
SERVE_NAME=blog-go
echo "now start serve is $SERVE_NAME"
PID=`ps -ef|grep ${SERVE_NAME}|grep -v grep|grep -v restart|grep -v $SERVE_NAME.sh|awk '{print$2}'`
if [ -n "$PID" ] ;then
        echo "now serve pid is $PID"
        kill -9 $PID
        sleep 10
fi
echo "now start server $SERVE_NAME "
nohup ./blog-go* > ./$SERVE_NAME.log 2>&1 &